<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>

    <link href="../css/sfmain.css" rel="stylesheet" type="text/css"></link>
    <script src="../js/jquery-1.11.3.min.js"></script>
    <script src="../js/common.js"></script>
    <!--		<script src="../js/sqlite.js"></script>-->
    <!--		<script src="../js/lfxgjy.js"></script>-->
    <script>
		$(function() {
			selectNewData();
		 });
		function saveInfo(){
            var happentime = $("#happentime").val();//随访日期
            var visityType = $("input[name='sffs']:checked").val();//随访方式
            var sfbr = $("input[name='sfbr']:checked").val();//是否本人
            var tgrgx = $("#tgrgx").val();//提供信息者与被访人关系
             var zz = "";//症状
				$('input:checkbox[name=zz]:checked').each(function (i) {
					if (0 == i) {
						zz = $(this).val();
					} else {
						zz += ("," + $(this).val());
					}
				});
            var zzqt = $("#zzqt").val();//症状其他
            var gjjx = $("input[name='gjjx']:checked").val();//关节畸形
            var lfsjj = $("input[name='lfsjj']:checked").val();//类风湿结节

            var gjyt = $("input[name='gjyt']:checked").val();//关节压痛
            var gy = $("#gy").val();//高压
            var dy = $("#dy").val();//低压
            var weight = $("#weight").val();//体重
            var heart = $("#heart").val();//心率
            var tzqt = $("#tzqt").val();//体征其他
            var sfjy = $("input[name='sfjy']:checked").val();//是否戒烟
            var sfjj = $("input[name='sfjj']:checked").val();//是否戒酒
            var sfbn = $("input[name='sfbn']:checked").val();//保暖
            var sm = $("input[name='sm']:checked").val();//睡眠
            var sfwx = $("input[name='wx']:checked").val();//午休
            var sysy = $("input[name='sysy']:checked").val();//少油少盐
            var zyz = $("input[name='zyz']:checked").val();//遵医嘱
            var xltz = $("input[name='xltz']:checked").val();//心里调整
            var fyycx = $("input[name='fyycx']:checked").val();//服药依从性
            var ywblfy = $("input[name='ywblfy']:checked").val();//药物不良反应
            var sffl = $("input[name='sffl']:checked").val();//此次随访分类
            var ywmc1 = $("#ywmc1").val();//药物名称1
            var mr1 = $("#mr1").val();//每日1
            var mc1 = $("#mc1").val();//每次1
            var ywmc2 = $("#ywmc2").val();//药物名称2
            var mr2 = $("#mr2").val();//每日2
            var mc2 = $("#mc2").val();//每次2
            var ywmc3 = $("#ywmc3").val();//药物名称3
            var mr3 = $("#mr3").val();//每日3
            var mc3 = $("#mc3").val();//每次3


            var sfys = $("#sfys").val();//随访医生
            var insertsql = "insert into lfsgjy(id,personid,name,sex,happentime,visityType,sfbr,tgrgx,zz,zzqt,gjjx,lfsjj,gjyt,gy,dy,weight,heart,"
                                +"tzqt,sfjy,sfjj,sfbn,sm,sfwx,sysy,zyz,xltz,fyycx,ywblfy,sffl,ywmc1,mr1,mc1,ywmc2,mr2,mc2,ywmc3,mr3,mc3,sfys) values("
                            +"'"+Math.floor(Math.random()*10)+"',"
                            +"'"+personid+"',"
                            +"'"+name+"',"
                            +"'"+sex+"',"
                            +"'"+happentime+"',"
                            +"'"+visityType+"',"
                            +"'"+sfbr+"',"
                            +"'"+tgrgx+"',"
                            +"'"+zz+"',"
                            +"'"+zzqt+"',"
                            +"'"+gjjx+"',"
                            +"'"+lfsjj+"',"
                            +"'"+gjyt+"',"
                            +"'"+gy+"',"
                            +"'"+dy+"',"
                            +"'"+weight+"',"
                            +"'"+heart+"',"
                            +"'"+tzqt+"',"
                            +"'"+sfjy+"',"
                            +"'"+sfjj+"',"
                            +"'"+sfbn+"',"
                            +"'"+sm+"',"
                            +"'"+sfwx+"',"
                            +"'"+sysy+"',"
                            +"'"+zyz+"',"
                            +"'"+xltz+"',"
                            +"'"+fyycx+"',"
                            +"'"+ywblfy+"',"
                            +"'"+sffl+"',"
                            +"'"+ywmc1+"',"
                            +"'"+mr1+"',"
                            +"'"+mc1+"',"
                            +"'"+ywmc2+"',"
                            +"'"+mr2+"',"
                            +"'"+mc2+"',"
                            +"'"+ywmc3+"',"
                            +"'"+mr3+"',"
                            +"'"+mc3+"',"
                            +"'"+sfys+"'"
                            +")";
            var jg = app.InsertSql(insertsql);
            if("success"==jg){
                alert("操作成功！");
            }

}

function selectNewData(){

	var selectsql = 'select * from lfsgjy where personid='+personid+" order by happentime desc";
  var data = app.getInfo4(selectsql);
        var obj = eval('(' + data + ')');
					if(null!=obj&&obj.length>0){
						var info = obj[0];
						$("#xm").html(info.name);
						$("#xb").html(info.sex);
						$("#happentime").val(info.happentime);//随访日期
						$("input[name='sffs'][value='"+info.visityType+"']").prop("checked",true);//随访方式
						$("input[name=sfbr]:eq("+info.sfbr+")").attr("checked",'checked');//是否本人
						$("#tgrgx").val(info.tgrgx);//提供信息者与被访人关系
						var zz = info.zz;//症状
						if(null!=zz&&zz.length>0){
						$(zz.split(",")).each(function (i,e){
							$("input[name='zz'][value='"+e+"']").prop("checked",true);
						});
					}
						$("#zzqt").val(info.zzqt);//症状其他
						$("input[name=gjjx]:eq("+info.gjjx+")").attr("checked",'checked');//关节畸形
						$("input[name=lfsjj]:eq("+info.lfsjj+")").attr("checked",'checked');//类风湿结节
						$("input[name='gjyt'][value='"+info.gjyt+"']").prop("checked",true);//关节压痛
						$("#gy").val(info.gy);//高压
						$("#dy").val(info.dy);//低压
						$("#weight").val(info.weight);//体重
						$("#heart").val(info.heart);//心率
						$("#tzqt").val(info.tzqt);//体征其他
						$("input[name=sfjy]:eq("+info.sfjy+")").attr("checked",'checked');//是否戒烟
						$("input[name=sfjj]:eq("+info.sfjj+")").attr("checked",'checked');//是否戒酒
						$("input[name='sfbn'][value='"+info.sfbn+"']").prop("checked",true);//是否保暖
						$("input[name='sm'][value='"+info.sm+"']").prop("checked",true);//睡眠

						$("input[name='wx'][value='"+info.sfwx+"']").prop("checked",true);//午休
						$("input[name='sysy'][value='"+info.sysy+"']").prop("checked",true);//少油少盐
						$("input[name=xltz]:eq("+info.xltz+")").attr("checked",'checked');//心里调整
						$("input[name=zyz]:eq("+info.zyz+")").attr("checked",'checked');//遵医嘱
						$("input[name='fyycx'][value='"+info.fyycx+"']").prop("checked",true);//服药依从性
						$("input[name=ywblfy]:eq("+info.ywblfy+")").attr("checked",'checked');//药物不良反应
						$("#ywmc1").val(info.ywmc1);//药物名称1
						$("#mr1").val(info.mr1);//每日1
						$("#mc1").val(info.mc1);//每次1
						$("#ywmc2").val(info.ywmc2);//药物名称2
						$("#mr2").val(info.mr2);//每日2
						$("#mc2").val(info.mc2);//每次2
						$("#ywmc3").val(info.ywmc3);//药物名称3
						$("#mr3").val(info.mr3);//每日3
						$("#mc3").val(info.mc3);//每次3
						$("input[name=sffl]:eq("+info.sffl+")").attr("checked",'checked');//此次随访分类
						 $("#sfys option[value='"+info.sfys+"']").attr("selected","selected");//随访医生
					}


}
		</script>
</head>
<body>
<div class="dh">
    <div class="dhleft">
        <span>类风湿关节炎随访记录表</span>
    </div>
    <div class="bc" onclick="saveInfo()">
        <img  class="bcimg" src="../img/icon-save.png"/>
        <span class="bcspan">保存</span>
    </div>
</div>
<div class="maindiv">
    <div class="sfxx">
        <span class="sfxxspan">随访信息</span>
    </div>
    <div>
        <hr class="titleline" />
    </div>
    <div class="titlaspan">
        <span>基本信息</span>
    </div>
    <div class="titlebody">
        <div>
            <span class="span1">姓名：</span>
            <span  id="xm" style="margin-left:5px;"></span>
            <span class="span1" style="margin-left: 100px;" >性别：</span>
            <span  id="xb" style="margin-left:5px;"></span>
        </div>
        <div>
            <span class="span1">随访日期：</span>
            <input class="timeinput" id="happentime" type="date"/>

        </div>
        <div>
            <span class="span1" >随访方式：</span>
            <input class="radio_type" type="radio" value="1" name="sffs" id="sffs1" checked="checked"/>
            <label for="sffs1">门诊</label>
            <input class="radio_type" type="radio" value="2" name="sffs" id="sffs2" />
            <label for="sffs2">家庭</label>
            <input class="radio_type" type="radio" value="3" name="sffs" id="sffs3" />
            <label for="sffs2">通过电话或者手机短信（微信）联系患者本人或者家人</label><br>
            <input class="radio_type" type="radio" style="margin-left: 105px;" value="4" name="sffs" id="sffs4" />
            <label for="sffs4">其他地方进行面对面教育</label>
            <input class="radio_type" type="radio" value="5" name="sffs" id="sffs5" />
            <label for="sffs5">其他</label>
        </div>
        <div>
            <span class="span1">是否本人：</span>
            <input class="radio_type" type="radio" name="sfbr" value="0" id="sfbr1" checked="checked"/>
            <label for="sfbr1">是</label>
            <input class="radio_type" type="radio" name="sfbr" value="1" id="sfbr2" />
            <label for="sfbr2">否</label>
            <span class="span1" style="width:auto;">提供信息者与被调查人直接的关系：</span>
            <input type="text" class="inputcss" id="tgrgx"/>
        </div>

    </div>

    <div class="titlaspan">
        <span>目前症状</span>
    </div>

    <div class="titlebody">
        <div>
            <ul>
                <li>
                    <input type="checkbox" class="inputbox" value="1" name="zz" id="zz1"/>
                    1无症状
                </li>
                <li>
                    <input type="checkbox" class="inputbox" style="margin-left: 27px;padding-left:27px;" value="2" name="zz" id="zz2"/>
                    2晨起僵硬
                </li>
                <li>
                    <input type="checkbox" class="inputbox" style="margin-left:27px;padding-left:27px;" value="3" name="zz" id="zz3"/>
                    3关节痛、肿
                </li>
                <li>
                    <input type="checkbox" class="inputbox" value="4" name="zz" id="zz4"/>
                    4关节活动障碍
                </li>
                <li>
                    <input type="checkbox" class="inputbox" value="5" name="zz" id="zz5"/>
                    5心悸胸闷
                </li>
            </ul>
           <ul>
               <li>
                   <input type="checkbox" class="inputbox" value="6" name="zz" id="zz6"/>
                   6口干、眼干
               </li>
               <li>
                   <input type="checkbox" class="inputbox" value="7" name="zz" id="zz7"/>
                   7特殊部位疼痛
               </li>
               <li>
                   <input type="checkbox" class="inputbox" value="8" name="zz" id="zz8"/>
                   8其他
                   <input type="text" class="inputcss" id="zzqt" style="width: 200px;"/>
               </li>
           </ul>







        </div>

    </div>
    <div class="titlaspan">
        <span>体征</span>
    </div>
    <div class="titlebody">
        <div >
            <span class="span1">关节畸形：</span>
            <input class="radio_type" type="radio" value="0" name="gjjx" id="gjjx1"/>
            <label for="gjjx1">有</label>
            <input class="radio_type" type="radio" value="1" name="gjjx" id="gjjx2" />
            <label for="gjjx2">无</label>
            <span class="span2">类风湿结节：</span>
            <input class="radio_type" type="radio" value="0" name="lfsjj" id="lfsjj1"/>
            <label for="lfsjj1">有</label>
            <input class="radio_type" type="radio" value="1" name="lfsjj" id="lfsjj2" />
            <label for="lfsjj2">无</label>
            <span class="span2">关节压痛：</span>
            <input class="radio_type" type="radio" value="0" name="gjyt" id="gjyt1"/>
            <label for="gjyt1">有</label>
            <input class="radio_type" type="radio" value="1" name="gjyt" id="gjyt2" />
            <label for="gjyt2">无</label>
        </div>
        <div>
            <span class="span1">血压(mmHg)：</span>
            <input type="number" class="inputcss" placeholder="高压" style="width: 40px;"  id="gy"/><span class="dw">/</span>
            <input type="number" placeholder="低压"  class="inputcss"  style="width: 40px;"    id="dy"/>
            <span class="span2">体重(kg)：</span>
            <input type="number" class="inputcss" style="width: 40px;"  id="weight"/>
            <span class="span2">心率(次/分)：</span>
            <input type="number" class="inputcss" style="width:40px;"  id="heart"/>
        </div>
        <div>
            <span class="span1">其他：</span>
            <input type="text" class="inputcss" id="tzqt" style="width: 200px;"/>
        </div>
    </div>
    <div class="titlaspan">
        <span>生活方式指导</span>
    </div>
    <div class="titlebody">
        <div>
            <span class="span1" style="width:auto">戒烟：</span>
            <input class="radio_type" type="radio" value="0" name="sfjy" id="sfjy1"/>
            <label for="sfjy1">是</label>
            <input class="radio_type" type="radio" value="1" name="sffy" id="sfjy2" />
            <label for="sfjy2">否</label>
            <span class="span2" style="width:auto">戒酒：</span>
            <input class="radio_type" type="radio" value="0" name="sfjj" id="sfjj1"/>
            <label for="sfjj1">是</label>
            <input class="radio_type" type="radio" value="1" name="sfjj" id="sfjj2" />
            <label for="sfjj2">否</label>
            <span class="span2" style="width:auto">保暖：</span>
            <input class="radio_type" type="radio" value="0" name="sfbn" id="sfbn1"/>
            <label for="sfbn1">是</label>
            <input class="radio_type" type="radio" value="1" name="sfbn" id="sfbn2" />
            <label for="sfbn2">否</label>
        </div>
        <div>
            <span class="span1" style="width:auto">睡眠：</span>
            <input class="radio_type" type="radio" value="0" name="sm" id="sm1"/>
            <label for="sm1">是</label>
            <input class="radio_type" type="radio" value="1" name="sm" id="sm2" />
            <label for="sm2">否</label>
            <span class="span2" style="width:auto">午休：</span>
            <input class="radio_type" type="radio" value="0" name="wx" id="wx1"/>
            <label for="wx1">是</label>
            <input class="radio_type" type="radio" value="1" name="wx" id="wx2" />
            <label for="wx2">否</label>
            <span class="span2" style="width:auto">少油少盐：</span>
            <input class="radio_type" type="radio" value="0" name="sysy" id="sysy1"/>
            <label for="sysy1">是</label>
            <input class="radio_type" type="radio" value="1" name="sysy" id="sysy2" />
            <label for="sysy2">否</label>
        </div>
        <div>
            <span class="span1" style="width:auto">遵医嘱：</span>
            <input class="radio_type" type="radio" value="0" name="zyz" id="zyz1"/>
            <label for="zyz1">是</label>
            <input class="radio_type" type="radio" value="1" name="zyz" id="zyz2" />
            <label for="zyz2">否</label>
            <span class="span2" style="width:auto">心理调整：</span>
            <input class="radio_type" type="radio" value="0" name="xltz" id="xltz1"/>
            <label for="xltz1">是</label>
            <input class="radio_type" type="radio" value="1" name="xltz" id="xltz2" />
            <label for="xltz2">否</label>
        </div>

    </div>
    <div class="titlaspan">
        <span>服药依从性</span>
    </div>
    <div class="titlebody">
        <input class="radio_type" type="radio" value="1" name="fyycx" id="fyycx1"/>
        <label for="fyycx1">规律</label>
        <input class="radio_type" type="radio" value="2" name="fyycx" id="fyycx2" />
        <label for="fyycx2">间断</label>
        <input class="radio_type" type="radio" value="3" name="fyycx" id="fyycx3" />
        <label for="fyycx3">不服药</label>
    </div>
    <div class="titlaspan">
        <span>药物不良反应</span>
    </div>
    <div class="titlebody">
        <input class="radio_type" type="radio" value="0" name="ywblfy" id="ywblfy1"/>
        <label for="ywblfy1">有</label>
        <input class="radio_type" type="radio" value="1" name="ywblfy" id="ywblfy2" />
        <label for="ywblfy2">无</label>
    </div>
    <div class="titlaspan">
        <span>此次随访分类</span>
    </div>
    <div class="titlebody">
        <div>
            <input class="radio_type" type="radio" value="0" name="sffl" id="sffl1"/>
            <label for="sffl1">1控制满意</label>
            <input class="radio_type" type="radio" value="2" name="sffl" id="sffl2"/>
            <label for="sffl2">2控制不满意</label>
            <input class="radio_type" type="radio" value="3" name="sffl" id="sffl3"/>
            <label for="sffl3">3不良反应</label>
            <input class="radio_type" type="radio" value="4" name="sffl" id="sffl4"/>
            <label for="sffl4">4并发症</label>
        </div>
    </div>
    <div class="titlaspan">
        <span>用药情况</span>
    </div>
    <div class="titlebody">
        <div>
            <span class="span1">药物名称1：</span>
            <input type="text" class="inputcss" id="ywmc1" style="width: 120px;"/>
            <span class="span2">用法：每日：</span>
            <input type="number" class="inputcss" id="mr1" style="width: 30px;"/><span class="dw">次</span>
            <span class="span2">每次：</span>
            <input type="number" class="inputcss" id="mc1" style="width: 30px;"/>
        </div>
        <div>
            <span class="span1">药物名称2：</span>
            <input type="text" class="inputcss" id="ywmc2" style="width: 120px;"/>
            <span class="span2">用法：每日：</span>
            <input type="number" class="inputcss" id="mr2" style="width: 30px;"/><span class="dw">次</span>
            <span class="span2">每次：</span>
            <input type="number" class="inputcss" id="mc2" style="width: 30px;"/>
        </div>
        <div>
            <span class="span1">药物名称3：</span>
            <input type="text" class="inputcss" id="ywmc3" style="width: 120px;"/>
            <span class="span2">用法：每日：</span>
            <input type="number" class="inputcss" id="mr3" style="width: 30px;"/><span class="dw">次</span>
            <span class="span2">每次：</span>
            <input type="number" class="inputcss" id="mc3" style="width: 30px;"/>
        </div>

    </div>

    <div  class="titlebody">
        <span class="span1">随访医生：</span>
        <select class="inputcss"   id="sfys">

        </select>
    </div>

</div>
</body>
</html>
